<?php

class spFloatingMenu extends spDiv
{
	private $ul;

	public function __construct( $title, $buttons )
	{
		parent::__construct();
		parent::addAttr( "id", "floatMenu" );
		
		parent::addChild( $this->createTitle( $title ) );
		
		$this->ul = new spUnorderedList();
		parent::addChild( $this->ul );
	
		if ( count($buttons) )
		{
			foreach ( $buttons as $b )
			{
				$this->addButton( $b );
			}
		}
	/*
			<div id="floatMenu">
<h3>Floating Menu</h3>
<ul>
	<li><a onclick="return false;" href="#">Menu Item 1</a></li>
	<li><a onclick="return false;" href="#">Menu Item 2</a></li>
	<li><a onclick="return false;" href="#">Menu Item 3</a></li>
	<li><a onclick="return false;" href="#">Menu Item 4</a></li>
	<li><a onclick="return false;" href="#">Menu Item 5</a></li>
	<li><a onclick="return false;" href="#">Menu Item 6</a></li>
	<li><a onclick="return false;" href="#">Menu Item 7</a></li>
	<li><a onclick="return false;" href="#">Menu Item 8</a></li>
</ul>
</div>


$but = new spInput( $b );
$but->addAttr( "type", "submit" );
*/
	}
	
	private function createTitle( $title )
	{
		return new spHeading( array("level"=>"3", "content"=>$title) );
	}

	public function addButton( $button )
	{
		$li = new spListItem();
		$this->ul->addChild( $li );

		$but = new spInput( array("value"=>$button["name"], "class"=>"ajaxForm" ) );
		$but->addAttr( "type", "submit" );
		$li->addChild( $but );
	}
	
	public function addButton_a( $button )
	{
		$li = new spListItem();
		$this->ul->addChild( $li );
		
		$a = new spAnchor();
		$a->addAttr( "onclick", "return false;" );
		$a->addAttr( "href", $button["href"] );
		$a->setContent( $button["name"] );
		$li->addChild( $a );		
	}
}

?>